Comb filter

ABSTRACT

In a method of compensating errors in comb filters in a line-locked sample domain, an input video signal (CVBS) is delayed (LD 1 , LD 2 ) by first and second integral numbers of lines to obtain first and second delayed signals, a phase difference is measured (PM) between at least two of the input video signal (CVBS) and the first and second delayed signals, and a phase of the input video signal (CVBS) and a phase of the second delayed signal are corrected (PC 1 , PC 2 ) with respect to the first delayed signal in dependence on the phase difference.

The invention relates to a comb filter.

Many comb filters use a burst-lock clock to sample the video data. Thishas the intrinsic advantage that the phase relation of the subcarrierbetween lines and fields is very well defined. Cross luminancesuppression can be very good, even under non-standard non-idealsituations. In a line-locked clock system, contrary to burst lock, thereare severe problems with non-standard line frequencies, because adeviating line frequency will diminish the cross-luminance suppression.Furthermore a line locked clock can create more jitter in the signalthan is to be expected from a well-designed burst lock system. It istherefore necessary to add special measures to the 3D-comb filter.

THE PROBLEM

Non-Standard Line-Frequencies.

Assume a line-locked sample domain. A video signal in this domain willhave a constant number of samples per line, irrespective of the linefrequency. Worst case the line frequency can deviate 4% from the nominalfrequency, which means (given a constant number of pixels per line) thatthe sample frequency varies + and −4% as well. The chrominancesubcarrier frequency is almost constant, so relative to the samplinggrid, the sub-carrier frequency will vary −/+4% as function of theline-frequency.

As an example, let us assume a line frequency that is 0.1% too high. Ona line locked grid this gives after sampling a color subcarrier that is0.1% (4433 Hz) lower than nominal. If we take two points that areexactly one line apart, they will have a subcarrier phase error of 120degrees. Comparing this with the required 1 . . . 2 degrees accuracy forcross-luminance suppression, it will be clear that a line-locked samplegrid can only be combined with a comb filter if special correctivemeasures are taken.

This problem is mainly of interest for a spatial comb filter, because itis generally accepted that a temporal comb filter is switched off undernon-standard conditions.

Jitter

The time constant of the PLL of the horizontal sync regeneration is ingeneral a number of TV lines. This means that between lines that areclose together in time, the jitter is negligible, but for lines that arefurther away in time (e.g. a field or more apart), the PLL will notsuppress noise very well and jitter can become larger. For normal TVthis is still sufficient, but for a comb filter, the demands are moresevere, mainly because the subtraction of two high frequency subcarriersneeds a very accurate phase between them. For PALplus an accuracy of 1ns is used while the performance of a line locked clock is 10 times lessaccurate.

It is, inter alia, an object of the invention to provide an improvedcomb filter. To this end, the invention provides a comb filter asdefined in the independent claims. Advantageous embodiments are definedin the dependent claims.

In accordance with a preferred aspect of the present invention, thephase of the other lines used in the comb filter is adapted to that ofthe current line. This relative way of working is well suited to theproblem at hand, because the position or phase of the current line isnot changed, hence there is no need to shift back after the comb filter,and the (burst key of the) current line functions as the referencesignal, so there is no need for a PLL and false-locking is not aproblem. A particular advantageous aspect of the invention is formed bycorrecting a frequency deviation due to a line-locked sampling grid bymeans of a combination of a phase meter and phase correction.

These and other aspects of the invention will be apparent from andelucidated with reference to the embodiments described hereinafter.

In the drawings:

FIG. 1 shows a block diagram of a prior art comb filter;

FIG. 2 shows a block diagram of a 3D luminance comb filter in accordancewith the present invention;

FIG. 3 shows a generic block diagram of a phase shift correction inaccordance with the present invention;

FIG. 4 shows a block diagram of a trigonometric solution of a combfilter in accordance with the present invention;

FIG. 5 shows a block diagram of a trigonometric solution with amplitudemeasurement in accordance with the present invention;

FIG. 6 shows a block diagram of a trigonometric implementation of thephase corrector in accordance with the present invention; and

FIG. 7 shows a block diagram of a Cordic implementation of the phasecorrector in accordance with the present invention.

FIG. 1 shows a prior art line-locked comb filter. A CVBS input signal isapplied to an A/D converter AD2 and thereafter comb filtered by a 3Dluminance comb filter 3D Y CF. The comb filter output signal is appliedto a band-pass filter BPF1 to furnish a color information signal C to acolor decoder COLDEC. The color decoder COLDEC provides a UV signal UV′.The comb filter signal is subtracted from the digitized CVBS signal toform the luminance output signal Y″. The A/D converter AD is clocked bya line-locked clock obtained by a PLL from H and V sync signals providedby a synchronization separator syncsep from the CVBS input signal.

In FIG. 2, the basic structure of the 3D luminance comb filter is given.The 3D-comb filter is a combination of a spatial and a temporal filter.A spatial comb filter uses the current line and lines that are 1 (NTSC)or 2 (PAL) lines above and below the current line in the same field. Atemporal comb filter uses the current line and one that is a field, 1frame (NTSC) or 2 frames (PAL) away in time. A motion detector fadesbetween both outputs depending on the local presence of motion. Theband-pass and high-pass filters are optimized for optimal suppression ofcross-luminance without loss of sharpness.

The digitized CVBS signal is applied to a line memories block LM toprovide the lines N+2, N and N+2 (PAL) or N−1, N, and N+1 (NTSC). In theremainder of this description, only the PAL situation will be described;those skilled in the art can easily adapt this to embodiments suitablefor NTSC. These lines are applied to a band-pass filter block BPF2, to aphase correction block PC, and to a spatial comb filter block SCF toprovide one input to a fader F. The digitized CVBS signal is alsoapplied to a field/frame memory block FM to provide the lineN-312/N-1250. The lines N and N-312/1250 are applied to a jittercorrection block JC and then to a temporal comb filter TCF to provideanother input of the fader F. The fader F is controlled by a motiondetector MD receiving signals from the line memories block LM and theframe/field memory block FM. A fader output is applied to a high-passfilter HPF to obtain a color signal that is subtracted from the line Nsignal to obtain the comb filtered luminance signal Y′.

First a solution for the non-standard line frequency problem. Later wewill see that the method can be applied with minimal changes to thejitter problem as well. It can be calculated that a correction for thenon-standard line frequency has to be in the form of a phase shiftingthat is equal for all sidebands of the subcarrier.

A generic block diagram for the correction of the spatial comb filter issketched in FIG. 3. The FIG. 3 circuit corresponds to the line memoriesblock LM plus the phase correction block PC in FIG. 2. In FIG. 3, theband-pass filter block BPF2 of FIG. 2 is left out to simplify theexplanation. The digitized CVBS signal is applied to first and secondline delays LD1, LD2. In a PAL environment, each line delay LD1, LD2delays by two lines, while in an NTSC environment, each line delay LD1,LD2 delays by one line. The output of line delay LD1 provides the line Nsignal. A phase meter PM compares the outputs of the line delays LD1 andLD2 to provide a control signal to a phase corrector PC2 coupled to theoutput of line delay LD2 and providing the line N−2 signal, and afterinversion, to a phase corrector PC1 receiving the digitized CVBS signaland providing the line N+2 signal. Note that we only need one phasemeter PM, since we expect the phase difference of the line below thecurrent line to be the inverse of that of the line above it.Alternatively, the phase meter inputs may be connected to receive theCVBS input signal and the output of the first line delay LD1, or theCVBS input signal and the output of the second line delay LD2, or allthree of the CVBS input signal and the outputs of the first and secondline delay LD1, LD2.

Phase Shifter

FIG. 4 shows an embodiment of a trigonometric solution. In comparisonwith FIG. 3, the following changes are made. Between the CVBS input andthe phase corrector PC1 there are a band-pass filter BPF3 and a Hilberttransform block HT1. A band-pass filter BPF4 is placed between theoutput of the line delay LD1 and the line N output. Between the outputof the line delay LD2 and the phase corrector PC2 there are a band-passfilter BPF5 and a Hilbert transform block HT2. Please note that in theembodiment of FIG. 2, the band-pass filter block BPF2 was also placedbetween the line memories block LM and the phase correction block PC.The phase correctors PC1, PC2 comprise each two multipliers and an adderfor summing the multiplier outputs. The phase meter PM comprises a firstmultiplier for multiplying the outputs of band-pass filters BPF4 andBPF5, a second multiplier for multiplying the outputs of the band-passfilter BPF4 and the Hilbert transform block HT2, a low-pass filter blockLPF receiving outputs of the multipliers, and a phase processing blockPP receiving outputs of the low-pass filter block LPF to provide controlsignals to the phase correctors PC1, PC2.

Next we will explain the functionality of the phase shifter, based onstandard trigonometry. Let us assume we have the situation of FIG. 4. Weassume that the input signal only contains frequencies that are relevantfor the comb filter. In a practical comb filter a band-pass filter willprecede the phase corrector.

Input signals during burst (only the subcarrier is present)V _(A) =A. sin(ωt−φ)V _(B) =A. sin(ωt)V _(C) =A. sin(ωt+φ)

For the phase meter PM we only use lines B and C. For the phasemeasurement, we need both inputs plus the 90 degrees phase shiftedversion of line C. Such a signal can be generated with a Hilberttransform, which is a special form of a FIR filter (see e.g. [1]) thatgives a standard phase shift of 90 degrees between input and output. Anexample of such a filter is [−1, 0, −7, 0, −38, 0, 38, 0, 7, 0, 1]/64.Note that the coefficients are anti-symmetrical. This is one of thebasic properties of this type of filter.

Output Hilbert Transform:V _(E) =A. cos(ωt+φ)We multiply now V_(C) and V_(E) with V_(B)$V_{F} = {{\frac{1}{2}A^{2}{\cos(\varphi)}} - {\frac{1}{2}\quad A^{2}{\cos\left( {{2\omega\quad t} + \varphi} \right)}}}$$V_{G} = {{\frac{1}{2}A^{2}{\sin(\varphi)}} - {\frac{1}{2}A^{2}{\sin\left( {{2\omega\quad t} + \varphi} \right)}}}$This signal is low pas filtered and the result averaged over at leastone burst period:V _(H) =A ² cos(φ)V _(I) =A ² sin(φ)The factor A² is disturbing the control function, because it willmodulate the output signal of the phase shifter, so we must divide thecontrol signals by this (normally constant) amplitude. Since a realdivider is costly, the correction is done by adapting the number ofpixels over which we average the phase. This is one of the functions ofthe “phase processing” block. Another function of it is a sample andhold function: the averaged result of the measurement during the burstis stored and used to correct during the scan. So we get as controlsignal during active video:V _(J)=cos(φ)V _(K)=sin(φ)During the scan, we multiply the main input signal with the controlsignalsV _(P) =V _(C) .V _(K) +V _(E) .Y _(J)V _(P) =A(t)sin(ωt+φ)cos(φ)+A(t)cos(φt+φ)sin(φ)V _(P) =A(t) sin(φt)We see that V_(P) is the wanted phase corrected signal for line N+2 asrequired. For line N+2 we do not have to measure the phase separately,because it is the inverse of that of line N+2. The correction is similarto that of line N+2.Amplitude Correction

As already mentioned, we need to normalize the phase control signals.For this we use a feed-back system. We measure the amplitude of V_(J)and V_(K).V _(Q) =V _(J) ² +V _(K) ²Assume that V_(J) and V_(K) have an amplitude error X:V _(Q)=(X sin(φ}}²+(X cos(φ))² =X ²V_(Q) is used to control the averaging in the phase processing block PP:if it is smaller than 1, we must use more pixels for the averaging, ifit is larger than 1 we need less pixels. In this way it is possible toimplement the divider in an elegant way without the need for a realdivider.

In comparison with FIG. 4, in FIG. 5 this control loop is added: the Jand K outputs of phase processing block PP are squared, the squares aresummed, and the sum Q is applied to the phase processing block PP. Itlooks like a difficult way to measure the burst amplitude but as we willsee later, it turns out to be cheap because it reuses multipliers thatare already available for another task.

Jitter Reduction

The jitter that is introduced during the AD conversion or the samplerate conversion is a time shift. A perfect solution would be a timeshift in the opposite direction. However, in this case the time shift issmall (fraction of a sample time) and we are only interested incompensating a relatively narrow band of frequencies near thesubcarrier. Under these conditions it is allowed to approximate the timeshift with a phase shift and hence the same method as described abovecan be used. The only difference is that in the spatial domain we expecta rather slowly varying phase offset while in the case of jitterremoval, the phase can change each line. Hence the averaging timeconstant might be different.

Practical Implementation

Trigonometric Solution

The formulas presented above can be implemented directly. It is possibleto decrease their number of multipliers by time multiplexing them. Weuse the same multipliers during the burst for measurement as we useduring active video for correction. As a result, the number ofmultipliers for a combination of a temporal and a spatial correctionneed to be only 8, saving 6. In the block diagram of FIG. 6 such amultiplexed system is sketched. This implementation is a combination ofa spatial and a temporal corrector, as is needed for a complete 3D combfilter. The inputs are the present line, its spatial neighbors (one linedistance for NTSC, two lines distance for PAL), and a temporal inputfrom 1, 2 or 4 fields previous. So, in FIGS. 6 and 7, the outputs N+2,N, N+2 are applied to a spatial comb filter, while the outputs N and ahigh-pass filtered signal N-T corresponding to a previous center lineare applied to a temporal comb filter (not shown).

The 90 degrees phase shifters needed for generating the sin and costerms are realized with Hilbert transform filters with coefficients [−1,0, −7, 0, −38, 0, 38, 0, 7, 0, 1]/64. The phase shift of this filter isexact 90 degrees for all frequencies. Since the amplitude transferbetween input and output is less than unity for very low and very highfrequencies, it can be used between 1.8 and 5 MHz, which is sufficientfor our purpose. The phase measurement and the shifter will onlyfunction correctly if the input is bandwidth-limited to frequencies thatare correctly shifted by the Hilbert transform. For the spatial filterthis is automatically fulfilled by the band-pass filters BPF3-BPF5 thatare already in the comb filter. For the temporal filter, there is nosuch filter in front of it, so we have to add one (HPF2). In fact wehave to add two (HPF1, HPF2), because there must also be a filter HPF1in the main path to keep the dynamic peaking working well. These filtershave coefficients [−1, 0, −6, 0, −15, 0, 44, 0, −15, 0, −6, 0, −1]/64.The transfer curve is similar to that of the Hilbert transform, but withlinear phase. All multipliers are 10 bit signed*10 bit signed. Theoutput is rounded to 10 bit signed again. The temporal section of theembodiment of FIG. 6 further comprises a field/frame delay FM, Hilberttransform blocks HT3, HT4, and a band-pass filter BPF6. The spatial andtemporal phase processing blocks PPS, PPT contain an averaging of the Iand Q signals in two stages: each line the average over the burstsamples is taken and there is an average over a number of lines, whichincludes the amplitude normalization of the I and Q signals. Theswitches are in the “a” positions during active video, and in the “b”positions during the burst periods.

Cordic Realization

There is another way to realize the phase corrector. This uses theCordic algorithm, which is an iterative algorithm, that can (dependingon the mode) either measure the angle of a vector or rotate a vectorover an arbitrary angle. A normal iterative algorithm would halve therotation angle each step (+/−90 degrees in the first step, +/−45 in thesecond, +/−22.5 in the third etc.). This is very computational intensivebecause it involves a lot of wide multiplications. The trick of Cordicis that the rotation angles are adapted such that all themultiplications become shifts. The algorithm is used in manyfloating-point coprocessors (Intel, HP etc.). We use it as phasedetector in the SECAM decoder of the Philips Digital Multi StandardDecoder (e.g. SAA7114, SAA7118). There are two basic modes:

1: to rotate any vector over such an angle that the output vector isalong the X-axis. By remembering the rotations of each iterative stepand adding them together, we know the total rotation, so we know theangle of the input vector. This is the mode we use for measuring.

2: to rotate a vector over an arbitrary angle. This is the mode we usefor the correction.

From literature it is known, that Cordic can be implemented in hardwarein a very efficient way, even for very high data frequencies. Unrollingthe iterative algorithm is than necessary. A good introduction of thealgorithm can be found in [2], to which reference is made for a numberof examples of possible hardware implementations.

A Cordic based implementation is shown in FIG. 7. Again we use the samehardware during the burst for measuring as we use for correction duringactive video. The uppermost Cordic circuit cordic1 measures the phase ofthe center line of the current frame during the burst. It corrects theline below the current center line during active video. The middleCordic circuit cordic2 measures and corrects the line above the currentfield. The lower Cordic circuit cordic3 measures and corrects the centerline of the previous field.

Note here a basic difference between the two solutions: in thetrigonometric solution, the phase difference between lines is directlymeasured. In case of the Cordic, the absolute phases of two lines aremeasured separately and the phase difference is calculated bysubtracting the two measurements. In case of a combined spatial/temporalcorrector, this saves one Cordic, because we can use the phase meter ofthe present line for both the temporal and the spatial measurement. Thismeans that we must measure the phase of the present line, one of thespatial neighbors (1 or 2 lines away) and the temporal neighbor (1, 2, 4fields away). Since we need also three Cordics for the correction (bothspatial neighbors and the temporal neighbor must be corrected regardingto the present line), this is the most effective implementation usingCordics. To obtain this minimum hardware/software implementation, someswitching is needed between the measurement and correction modes.

The temporal and spatial phase processing blocks PPT, PPS containaveraging over the pixels of the burst for each line and an averagingover a selectable number of lines. To allow reliable averaging for allphase differences, including at 180 degrees, an additional correction isapplied.

A Cordic implementation is more economical than a trigonometricimplementation. Even if a Cordic is twice as complex as a multiplier, itis still attractive to use the Cordic version. Apart from the size thereare other advantages: The measured phase is independent of the burstamplitude. No (implicit) divider is needed. Note however that with smallburst amplitudes the accuracy of the phase suffers, but so does the needfor accuracy since a smaller burst will be less visible anyhow. There isless switching needed to use the hardware efficiently. The measuredphase does not contain higher harmonics, so less filtering is needed inthe “processing” blocks. 3 instead of 4 Hilbert transforms are needed.All three Cordics are in the same mode at the same time. This makes itpossible to time-multiplex them. If the clock frequency can be threetimes the sample frequency, the hardware may consist of only one Cordic.

There are also some drawbacks: The output signal of a Cordic is largerthan the input. The amplification is constant (1.647 times). The onlyway to compensate for this is by multiplying the outputs with 0.6073,which makes this solution slightly more costly, but since it is amultiplication with a constant, it does not need a complete multiplier.The phase meter has a range of −π . . . +π. This means that there isinevitably a jump at −π. Partly this can be solved by mapping the phaseon a digital scale of −1024 . . . 1023. An 11 bit signed signal willoverflow at precise the right point. However, there are somecomplications when averaging over a number of pixels, which leads tosome extra hardware or software. The trigonometric version does not haveany non-linearity and is slightly simpler in this respect.

Summary

A method is disclosed which compensates for the problem that a combfilter working on a line-locked grid cannot cope with non-standard linefrequencies because cross-luminance suppression deterioratesconsiderably, by shifting the phase of the lines used for combing,relative to the present line. It can be proven that for deviating lineand/or subcarrier frequencies, a phase shift is the best possiblecompensation and can be implemented relatively cheap, e.g. using eithera limited number of multipliers or a few Cordic blocks. The same methodcan also be used to compensate for jitter in the sync and clock circuitof the receiver as long as the jitter is not excessive. An aspect of theinvention is that is it possible to use the same hardware for the phasemeasurement and for the correction, thus reducing the cost ofimplementation. The result is comparable with that of a burst-lockedcomb filter. The extra complexity of the circuit is not very big, mainlydue to the fact that the expensive hardware (multipliers or Cordics) canbe shared between the measurement during the burst and the correctionduring active video. The Cordic implementation gives a slightly morerobust impression, which is caused by the fact that the correctionsignal is not dependent on the burst amplitude.

It should be noted that the above-mentioned embodiments illustraterather than limit the invention, and that those skilled in the art willbe able to design many alternative embodiments without departing fromthe scope of the appended claims. In the claims, any reference signsplaced between parentheses shall not be construed as limiting the claim.The word “comprising” does not exclude the presence of elements or stepsother than those listed in a claim. The word “a” or “an” preceding anelement does not exclude the presence of a plurality of such elements.The invention can be implemented by means of hardware comprising severaldistinct elements, and by means of a suitably programmed computer. Inthe device claim enumerating several means, several of these means canbe embodied by one and the same item of hardware. The mere fact thatcertain measures are recited in mutually different dependent claims doesnot indicate that a combination of these measures cannot be used toadvantage.

LITERATURE

-   [1] Enden, Ad W. M. van den, Efficiency in multirate and complex    digital signal processing, Appendix F, Waalre 2001, ISBN 90 6674 650    5-   [2] Andraka, Ray, A survey of Cordic algorithms for FPGA based    computers, 1998 (full text available from    http://www.andraka.com/cordic.htm)

1. A method of compensating errors in comb filters in a line-lockedsample domain, the method comprising: delaying (LD1, LD2) an input videosignal (CVBS) by first and second integral numbers of lines to obtainfirst and second delayed signals; measuring (PM) a phase differencebetween at least two of said input video signal (CVBS) and said firstand second delayed signals; and correcting (PC1, PC2) a phase of saidinput video signal (CVBS) and a phase of said second delayed signal withrespect to said first delayed signal in dependence on said phasedifference.
 2. A method as claimed in claim 1, wherein said phasecorrecting step (PC1, PC2) comprises: multiplying a phase correctioninput signal (A, C) by first phase measurement signals (L, K) to obtaina first product; Hilbert transforming (HT1, HT2) said phase correctioninput signal (A, C) to obtain a Hilbert transformed signal (D, E);multiplying the Hilbert transformed signal (D, E) by second phasemeasurement signals (M, J) to obtain a second product; and summing saidfirst and second products.
 3. A method as claimed in claim 1, whereinsaid phase difference measuring step (M) comprises: Hilbert transforming(HT2) a phase correction input signal (C) to obtain a Hilberttransformed signal (E); multiplying said first delayed signal (B) bysaid Hilbert transformed signal (E) to obtain a first product signal(G); multiplying said first delayed signal (B) by said phase correctioninput signal (C) to obtain a second product signal (F); low-passfiltering (LPF) said first and second product signals to obtain low-passfiltered signals (H, I); and phase processing (PP) said low-passfiltered signals (H, I) to obtain phase measurement signals (J, K).
 4. Acomb filter in a line-locked sample domain, the comb filter comprising:means for delaying (LD1, LD2) an input video signal (CVBS) by first andsecond integral numbers of lines to obtain first and second delayedsignals; means for measuring (PM) a phase difference between at leasttwo of said input video signal (CVBS) and said first and second delayedsignals; and means for correcting (PC1, PC2) a phase of said input videosignal (CVBS) and a phase of said second delayed signal with respect tosaid first delayed signal in dependence on said phase difference.
 5. Acolor television apparatus comprising: means for tuning and demodulatinga television signal to obtain a video signal (CVBS); a comb filter asclaimed in claim 4 to obtain luminance and chrominance signals; meansfor processing said luminance and chrominance signals to obtain displaysignals (R, G, B); and means for displaying said display signals. (R, G,B).